﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MODASA.HojaDefinicionProducto
{
    public partial class HSPPuerta_Trampilla : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["HDP"] == null)
            {
                Page.Response.Redirect("HDPModelos.aspx");

            }  
        }

        protected void RBLPUECON_SelectedIndexChanged(object sender, EventArgs e)
        {
            HabilitarDesabilitarPuertas(RBLPUECON.Text);
        }

        private void HabilitarDesabilitarPuertas(string res) {
            if (res == "NO") {
                RBLPUEPAS.Enabled = false;
                RBLPUECAB.Enabled = false;
                HLPUERCOND.Visible = false;
            }
            else if (res == "SI") {
                RBLPUEPAS.Enabled = true;
                RBLPUECAB.Enabled = true;
                HLPUERCOND.Visible = true;
                HLPUERCOND.ImageUrl = "../images/Buses/ImgInt/Puerta-Trampilla/m_PuertaPiloto.png";
                HLPUERCOND.NavigateUrl = "../images/Buses/ImgInt/Puerta-Trampilla/PuertaPiloto.png";
            }
        }

        protected void RBLBLOQTAP_SelectedIndexChanged(object sender, EventArgs e)
        {
            CargarTapaMotor(RBLBLOQTAP.Text);

        }

        private void CargarTapaMotor(string res) {

            if (res == "SI")
            {
                HLTAPAMOTOR.Visible = true;
                HLTAPAMOTOR.ImageUrl = "../images/Buses/ImgInt/Puerta-Trampilla/m_TapaMotor.png";
                HLTAPAMOTOR.NavigateUrl = "../images/Buses/ImgInt/Puerta-Trampilla/TapaMotor.png";
            }
            else {
                HLTAPAMOTOR.Visible = false;
                
            }
        
        }

        protected void RBLBLOQPUE_SelectedIndexChanged(object sender, EventArgs e)
        {
            CargarPuertaBodega(RBLBLOQPUE.Text);
        }

        private void CargarPuertaBodega(string res) {

            if (res == "SI")
            {
                HLPUERBODEGA.Visible = true;
                HLPUERBODEGA.ImageUrl = "../images/Buses/ImgInt/Puerta-Trampilla/m_PuertaBodega.png";
                HLPUERBODEGA.NavigateUrl = "../images/Buses/ImgInt/Puerta-Trampilla/PuertaBodega.png";
            }
            else {
                HLPUERBODEGA.Visible = false;
            }    
        }

        protected void RBLBLOTRAM_SelectedIndexChanged(object sender, EventArgs e)
        {
            CargarTrampillaBodega(RBLBLOTRAM.Text);
        }

        private void CargarTrampillaBodega(string res) {

            if (res == "SI")
            {
                HLTRAMBODE.Visible = true;
                HLTRAMBODE.ImageUrl = "../images/Buses/ImgInt/Puerta-Trampilla/m_TapaBodega.png";
                HLTRAMBODE.NavigateUrl = "../images/Buses/ImgInt/Puerta-Trampilla/TapaBodega.png";
            }
            else {
                HLTRAMBODE.Visible = false;
            }
        
        }

    }
}